package bjut.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author: zhuzhiming
 * @Date: 2022/4/12 21:05
 */
@Getter
@AllArgsConstructor
public enum CompressTypeEnum {

    GZIP((byte) 0x01, "gzip");

    private final byte code;
    private final String type;


    public static String getCompressType(byte code) {
        for (CompressTypeEnum type : CompressTypeEnum.values()) {
            if (code == type.getCode()) {
                return type.getType();
            }
        }
        return null;
    }

}
